#pragma once

#include "e2d/core/Component.h"

namespace e2d
{
	struct CameraView :public e2d::Component
	{
		FXCC_DEFINE_COMPONENT_LABEL(CameraView);

		e2d::ProjData m_ProjData;

		int m_NrComponent{ 4 };

		int m_HDR{ true };

		glm::vec4 m_BackgroundColor{ 0.f,0.f,0.f,1.0f };

		bool m_ClearColor{ true };

		bool m_ClearDepthStencil{ true };

		int m_EditingIndex{ 0 };

		std::shared_ptr<e2d::RenderTargetJack> m_RenderTarget;

		e2d::EntityMap m_SourceCamera;

		void OnLoad();

		glm::mat4 GetProjMatrix() const;

		void BeginRTT() const;

		void EndRTT() const;

		void CopySource();

		void UpdatePassData(e2d::Effect3d::PassData& passData);

		std::shared_ptr<e2d::Texture2DJack> GetTextureEditing() const;

	};
};